#ifndef TITLEHEADERWIDGET_H
#define TITLEHEADERWIDGET_H

#include <QWidget>
#include <QHBoxLayout>
#include <QLabel>
#include <QPushButton>

class TitleHeaderWidget : public QWidget
{
    Q_OBJECT
public:
    explicit TitleHeaderWidget(QWidget *parent = 0);
    virtual ~TitleHeaderWidget() {};

    virtual void paintEvent(QPaintEvent *e);
    virtual bool eventFilter(QObject *obj, QEvent *event);
    
    void setTitle(const QString& strTitle) { labelHeadTitle->setText(strTitle); }
    void setDragHeight(int iHeight) { iDragHeight = iHeight; }

public Q_SLOTS:
    void closeButtonClicked(bool checked = false);

protected:
    virtual void mousePressEvent1(QMouseEvent *event);
    virtual void mouseMoveEvent1(QMouseEvent *event);
    virtual void mouseReleaseEvent1(QMouseEvent *event);
private:
    QPoint      mMovePosition;
    int         iDragHeight;

    QHBoxLayout *horizontalLayout;
    QLabel *labelHeadTitle;
    QSpacerItem *horizontalSpacer;
    QPushButton *btnHeadClose;
};

#endif // TITLEHEADERWIDGET_H